import { AppConfig } from '@/utils/back/appConfig';
import { NextRequest, NextResponse } from 'next/server';
// const data = {
//   count: 10,
//   name: 'sss',
// };

export async function GET(req: NextRequest) {
  // const data = await AppConfig.get();
  return NextResponse.json({
    status: 'ok',
    message: 'Hello Test',
    data: { count: AppConfig.count },
    time: new Date().toISOString(),
  });
}

export async function POST(req: NextRequest) {
  // const data = await AppConfig.get();
  AppConfig.count = AppConfig.count + 1;
  return NextResponse.json({
    status: 'ok',
    message: 'Hello Test',
    data: { count: AppConfig.count },
    time: new Date().toISOString(),
  });
}
